import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-07-06
 * Time: 15:27
 */
public class Test33 {
    public static class ListNode {
        int val;
        ListNode next;

        ListNode(int val) {
            this.val = val;
            next = null;
        }
        ListNode() {

        }
    }

    public static ListNode sortList(ListNode head) {
        //出口
        if(head == null || head.next == null) {
            return head;
        }
        // 找中间节点
        ListNode fast = head.next;
        ListNode slow = head;

        while(fast != null && fast.next != null) {
            fast = fast.next.next;
            slow = slow.next;
        }
        ListNode mid = slow.next;
        slow.next = null;

        ListNode left = sortList(head);
        ListNode right = sortList(mid);

        ListNode ret = merge(left,right);

        return ret;
    }

    public static ListNode merge(ListNode left,ListNode right) {
        ListNode newHead = new ListNode();
        ListNode cur = newHead;

        while(left != null && right != null) {
            if(left.val < right.val) {
                cur.next = left;
                left = left.next;
            }else {
                cur.next = right;
                right = right.next;
            }
            cur = cur.next;
        }
        cur.next = left != null ? left : right;
        return newHead.next;
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ListNode head = null, tail = null;
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int val = sc.nextInt();
            ListNode node = new ListNode(val);
            if (head == null) {
                head = node;
            } else {
                tail.next = node;
            }
            tail = node;
        }
        ListNode ret = sortList(head);
        while(ret != null) {
            System.out.print(ret.val+" ");
            ret = ret.next;
        }
    }
}
